<h1 class="page-header">
    <small>后台菜单管理</small>
</h1>
<hr/>
<div class="panel panel-inverse" data-sortable-id="form-stuff-5">
    <div class="panel-heading">
        <h4 class="panel-title">菜单查询</h4>
    </div>
    <div class="panel-body">
        <form id="sourceForm" name="sourceForm" method="post" class="form-inline">
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="LIKE_name" value="${LIKE_name}"
                       placeholder="菜单名称">
            </div>
            <div class="form-group m-r-10">
                <select name="EQ_parent.id" class="form-control">
                    <#if sourceTree?has_content && sourceTree?exists>
                        <option value="">上级菜单</option>
                        <#list sourceTree as st>
                            <option value="${st.id}" <#if EQ_parent_id == st.id> selected</#if>>${st.name}</option>
                        </#list>
                    </#if>
                </select>
            </div>
            <button type="button" class="btn btn-sm btn-success m-r-5"
                    onclick="postDataByForm('source/query','displayArea','sourceForm')"><i class="fa fa-search"></i>查 询
            </button>
            <button type="button" class="btn btn-sm btn-danger m-r-5"
                    onclick="getData('${rc.contextPath}/source/add','displayArea')"><i class="fa fa-plus"></i>新增
            </button>
        </form>
    </div>
</div>
<hr/>
<div class="panel panel-inverse" data-sortable-id="table-basic-4">
    <div class="panel-heading">
        <h4 class="panel-title">菜单列表</h4>
    </div>
    <div class="panel-body">
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
                <th>编号</th>
                <th>名称</th>
                <th>URL</th>
                <th>级别</th>
                <th>上级</th>
                <th>排序</th>
                <th>日志</th>
                <th>状态</th>
                <th>描述</th>
                <th>操作</th>
            </tr>
            </tbody>
            <#if paginationResponse?has_content && paginationResponse.content?exists>
                <#list paginationResponse.content as ct>
                    <tr>
                        <td>${ct.id}</td>
                        <td>${ct.name}</td>
                        <td>${ct.sourceCode}</td>
                        <td>${ct.level}</td>
                        <td>${ct.parent.name}</td>
                        <td>${ct.style}</td>
                        <td>
                            <#if ct.isLog == 0>
                                否
                                <#else>
                                    是
                            </#if>
                        </td>
                        <td>
                            <#if ct.status == 'A'>
                                有效
                                <#else>
                                    无效
                            </#if>
                        </td>
                        <td>${ct.description}</td>
                        <td>
                            <a class="label label-danger small-btn" href="javascript:getConfirmData('确定删除该菜单吗?','${rc.contextPath}/source/delete/${ct.id}','displayArea')"><i class="fa fa-trash"></i>删除</a>
                            <a class="label label-success small-btn" href="javascript:getData('${rc.contextPath}/source/edit/${ct.id}','displayArea')"><i class="fa fa-edit"></i>修改</a>
                        </td>
                    </tr>
                </#list>
            </#if>
        </table>
        <!-- 分页组件 -->
        <!-- recordBean 分页查询结果Bean
             action 分页请求URL
             formName 分页需要的查询参数的表单名称 -->
        <@sp.pagination recordBean=paginationResponse action="${rc.contextPath}/source/query" formName="sourceForm"/>